﻿//天地图

//影像
define([
    "dojo/_base/declare"
    , "esri/layers/TiledMapServiceLayer"
    , "esri/SpatialReference"
    , "esri/geometry/Extent"
    , "esri/layers/TileInfo"
], function (declare
    , TiledMapServiceLayer
    , SpatialReference
    , Extent
    , TileInfo) {
    var SzCustom_midnight_c = declare([TiledMapServiceLayer], {
        constructor: function () {
            this.spatialReference = new SpatialReference({wkid: 4326});
            this.initialExtent = (this.fullExtent = new Extent(99.88030895286676,
                21.774090555555528,
                138.33239880708402,
                48.23369694038829, this.spatialReference));
            this.tileInfo = new TileInfo({
                "rows": 256,
                "cols": 256,
                "compressionQuality": 0,
                "origin": {
                    "x": -400.0,
                    "y": 399.9999999999998
                },
                "spatialReference": {
                    "wkid": 4326
                },
                "lods": [
                    {"level": 0, "resolution": 0.010986328125, "scale": 4617149.8915429693}
                    , {"level": 1, "resolution": 0.0054931640625, "scale": 2308574.9457714846}
                    , {"level": 2, "resolution": 0.00274658203125, "scale": 1154287.4728857423}
                    , {"level": 3, "resolution": 0.001373291015625, "scale": 577143.73644287116}
                    , {"level": 4, "resolution": 0.0006866455078125, "scale": 288571.86822143558}
                    , {"level": 5, "resolution": 0.00034332275390625, "scale": 144285.93411071779}
                    , {"level": 6, "resolution": 0.000171661376953125, "scale": 72142.967055358895}
                    , {"level": 7, "resolution": 8.58306884765625e-005, "scale": 36071.483527679447}
                    , {"level": 8, "resolution": 4.291534423828125e-005, "scale": 18035.741763839724}
                    , {"level": 9, "resolution": 2.1457672119140625e-005, "scale": 9017.8708819198619}
                    , {"level": 10, "resolution": 1.0728836059570313e-005, "scale": 4508.9354409599309}
                    , {"level": 11, "resolution": 5.3644180297851563e-006, "scale": 2254.4677204799655}
                ]
            });
            this.loaded = true;
            this.onLoad(this);
        },
        getTileUrl: function (level, row, col) {
           // var url = `http://58.210.204.107:10055/arcgis/rest/services/szRiver/szVector3/MapServer/tile/${level}/${row}/${col}`;
            var url = `http://221.224.13.15:8181/arcgis/rest/services/%E8%8B%8F%E5%B7%9E%E6%B1%A1%E6%9F%93%E9%98%B2%E6%B2%BB%E6%94%BB%E5%9D%9A%E5%B9%B3%E5%8F%B0/szVector3/MapServer/tile/${level}/${row}/${col}`
            return url;
        }
    });
    return SzCustom_midnight_c;
});